<?php
include('./files/class.db.php');

function selectDatiDb($start_data,$end_data,$segnale)
{
	$msql  = new Db;
	$msql->connect();
	
	$query="SELECT data,$segnale FROM dati_impianto where data >= '$start_data' and data <= '$end_data';";
	//echo $query;
	$arr=$msql->execute_select($query);
	//print_r($arr);
	
	for ($row = 0; $row < count($arr); $row++)
	{
		for ($col=0;$col< count($row) ; $col++)
		{
				echo $arr[$row][$col]." ".$arr[$row][$col];
		}
		echo "\n";
	}

	$msql->disconnettiDB();
	return 0;
}
selectDatiDb('2011-03-27 06:00:00','2011-03-28 05:00:00','P1Pz01');	

?>